package com.guocheng.Utils.MapStruct;

import com.guocheng.model.dto.GoodInfoDto;
import com.guocheng.model.po.GoodInfo;
import com.guocheng.model.po.GoodType;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface GoodInfoStruct {
    @Mappings({
            @Mapping(source = "goodInfo.id",target = "goodId"),
            @Mapping(source = "goodInfo.title",target = "goodTitle"),
            @Mapping(source = "goodInfo.price",target = "goodPrice"),
            @Mapping(source = "goodType.tgtName",target = "typeName")
    })
    public GoodInfoDto from(GoodInfo goodInfo,GoodType goodType);
}
